<?php

namespace app\common\repositories\system\recruit;

use app\common\dao\system\recruit\RecruitDao;
use app\common\repositories\BaseRepository;

class RecruitRepository extends BaseRepository
{
    public function __construct(RecruitDao $dao)
    {
        $this->dao = $dao;
    }

    public function getList(array $where, int $page, int $limit , $order = 'create_time')
    {
        $query = $this->dao->getSearch($where);
        $count = $query->count();
        $list = $query->page($page, $limit)->order($order)->select();
        return compact('count','list');
    }

    public function merExists(int $id, $except = null)
    {
        return $this->dao->merFieldExists($this->dao->getPk(), $id, $except);
    }



}
